package com.t2two.example.convert;

import com.t2two.example.entity.userinfo.ExportExcelTitle;
import com.t2two.example.entity.userinfo.ScoreInfo;
import com.t2two.example.entity.userinfo.StudentInfo;
import com.t2two.example.entity.userinfo.UserInfo;

import java.math.BigDecimal;
import java.sql.Time;
import java.util.*;

/**
 * @version 1.0
 * @description: TODO
 * @author: lifei
 * @date: 2024/6/20 17:44
 */
public class ConvertUserInfo {

    public static List<UserInfo> getUserInfoList(){
        List<UserInfo> list = new ArrayList<>();
        UserInfo userInfo = new UserInfo();
        userInfo.setId(110);
        userInfo.setIdCard("411403201111168236");
        userInfo.setRegionCode("411403000000");
        userInfo.setName("name110");
        userInfo.setMoney(new BigDecimal("110"));
        userInfo.setAge(110);
        userInfo.setGuid(110L);
        userInfo.setFlag(Boolean.TRUE);
        userInfo.setCreateDate(new Date());
        userInfo.setUpdateDate(new Date());
        userInfo.setTimes(new Time(1718852400000L));
        userInfo.setMemo("memo110");
        userInfo.setDoubleMoney(110.11);
        list.add(userInfo);

        userInfo = new UserInfo();
        userInfo.setId(120);
        userInfo.setIdCard("411403202008093437");
        userInfo.setRegionCode("411403000000");
        userInfo.setName("name120");
        userInfo.setMoney(new BigDecimal("120"));
        userInfo.setAge(120);
        userInfo.setGuid(120L);
        userInfo.setFlag(Boolean.TRUE);
        userInfo.setCreateDate(new Date());
        userInfo.setUpdateDate(new Date());
        userInfo.setTimes(new Time(1718856000000L));
        userInfo.setMemo("memo120");
        userInfo.setDoubleMoney(120.22);
        list.add(userInfo);

        userInfo = new UserInfo();
        userInfo.setId(130);
        userInfo.setIdCard("411403198607162060");
        userInfo.setRegionCode("411403000000");
        userInfo.setName("name130");
        userInfo.setMoney(new BigDecimal("130"));
        userInfo.setAge(130);
        userInfo.setGuid(130L);
        userInfo.setFlag(Boolean.TRUE);
        userInfo.setCreateDate(new Date());
        userInfo.setUpdateDate(new Date());
        userInfo.setTimes(new Time(1718859600000L));
        userInfo.setMemo("memo130");
        userInfo.setDoubleMoney(130.33);
        list.add(userInfo);

        userInfo = new UserInfo();
        userInfo.setId(110);
        userInfo.setIdCard("411403201111168236");
        userInfo.setRegionCode("411403000000");
        userInfo.setName("name1");
        userInfo.setMoney(new BigDecimal("110"));
        userInfo.setAge(110);
        userInfo.setGuid(110L);
        userInfo.setFlag(Boolean.TRUE);
        userInfo.setCreateDate(new Date());
        userInfo.setUpdateDate(new Date());
        userInfo.setTimes(new Time(1718852400000L));
        userInfo.setMemo("memo110");
        userInfo.setDoubleMoney(110.11);
        list.add(userInfo);

        userInfo = new UserInfo();
        userInfo.setId(150);
        userInfo.setIdCard("411403200902088801");
        userInfo.setRegionCode("411403000000");
        userInfo.setName("name150");
        userInfo.setMoney(new BigDecimal("150"));
        userInfo.setAge(150);
        userInfo.setGuid(150L);
        userInfo.setFlag(Boolean.TRUE);
        userInfo.setCreateDate(new Date());
        userInfo.setUpdateDate(new Date());
        userInfo.setTimes(new Time(1718866800000L));
        userInfo.setMemo("memo150");
        userInfo.setDoubleMoney(150.55);
        list.add(userInfo);

        userInfo = new UserInfo();
        userInfo.setId(160);
        userInfo.setIdCard("411403199710284263");
        userInfo.setRegionCode("411403000000");
        userInfo.setName("name160");
        userInfo.setMoney(new BigDecimal("160"));
        userInfo.setAge(160);
        userInfo.setGuid(160L);
        userInfo.setFlag(Boolean.TRUE);
        userInfo.setCreateDate(new Date());
        userInfo.setUpdateDate(new Date());
        userInfo.setTimes(new Time(1718870400000L));
        userInfo.setMemo("memo160");
        userInfo.setDoubleMoney(160.66);
        list.add(userInfo);

        userInfo = new UserInfo();
        userInfo.setId(170);
        userInfo.setIdCard("411403198007110697");
        userInfo.setRegionCode("411400000000");
        userInfo.setName("name170");
        userInfo.setMoney(new BigDecimal("170"));
        userInfo.setAge(170);
        userInfo.setGuid(170L);
        userInfo.setFlag(Boolean.TRUE);
        userInfo.setCreateDate(new Date());
        userInfo.setUpdateDate(new Date());
        userInfo.setTimes(new Time(1718874000000L));
        userInfo.setMemo("memo170");
        userInfo.setDoubleMoney(170.77);
        list.add(userInfo);

        userInfo = new UserInfo();
        userInfo.setId(170);
        userInfo.setIdCard("411403198007110697");
        userInfo.setRegionCode("411400000000");
        userInfo.setName("name170");
        userInfo.setMoney(new BigDecimal("170"));
        userInfo.setAge(170);
        userInfo.setGuid(170L);
        userInfo.setFlag(Boolean.TRUE);
        userInfo.setCreateDate(new Date());
        userInfo.setUpdateDate(new Date());
        userInfo.setTimes(new Time(1718874000000L));
        userInfo.setMemo("memo170");
        userInfo.setDoubleMoney(170.77);
        list.add(userInfo);

        userInfo = new UserInfo();
        userInfo.setId(180);
        userInfo.setIdCard("411403199007163080");
        userInfo.setRegionCode("411400000000000000");
        userInfo.setName("name180");
        userInfo.setMoney(new BigDecimal("180"));
        userInfo.setAge(180);
        userInfo.setGuid(180L);
        userInfo.setFlag(Boolean.TRUE);
        userInfo.setCreateDate(new Date());
        userInfo.setUpdateDate(new Date());
        userInfo.setTimes(new Time(1718877600000L));
        userInfo.setMemo("memo180");
        userInfo.setDoubleMoney(180.88);
        list.add(userInfo);

        userInfo = new UserInfo();
        userInfo.setId(190);
        userInfo.setName("name190");
        userInfo.setMoney(new BigDecimal("190"));
        userInfo.setCreateDate(new Date());
        userInfo.setUpdateDate(new Date());
        userInfo.setTimes(new Time(1718877600000L));
        list.add(userInfo);

        userInfo = new UserInfo();
        userInfo.setId(200);
        userInfo.setName("name200");
        userInfo.setMoney(new BigDecimal("200"));
        userInfo.setCreateDate(new Date());
        userInfo.setUpdateDate(new Date());
        userInfo.setTimes(new Time(1718877600000L));
        list.add(userInfo);

        return list;
    }

    public static UserInfo getUserInfoSon(){
        UserInfo userInfo = new UserInfo();
        userInfo.setId(510);
        userInfo.setName("name510");
        userInfo.setMoney(new BigDecimal("510"));
        userInfo.setAge(510);
        userInfo.setGuid(510L);
        userInfo.setFlag(Boolean.TRUE);
        userInfo.setCreateDate(new Date());
        userInfo.setUpdateDate(new Date());
        userInfo.setTimes(new Time(1718852400000L));
        userInfo.setMemo("memo510");
        userInfo.setDoubleMoney(510.11);
        // 添加学生信息
        StudentInfo studentInfo = new StudentInfo();
        studentInfo.setId(511);
        studentInfo.setGuid(511L);
        studentInfo.setAge(51);
        studentInfo.setCreateTime(new Date());
        studentInfo.setScore(511.11);
        studentInfo.setMoney(new BigDecimal("511.789"));
        studentInfo.setName("studentName学生名称_511");
        studentInfo.setFlag(Boolean.TRUE);
        userInfo.setStudentInfo(studentInfo);
        // 添加成绩信息
        List<ScoreInfo> scoreInfoList = new ArrayList<>();
        ScoreInfo scoreInfo = new ScoreInfo();
        scoreInfo.setId(515);
        scoreInfo.setGuid(515L);
        scoreInfo.setStudentInfoId(511);
        scoreInfo.setStudentInfoGuid(511L);
        scoreInfo.setScore(515.0);
        scoreInfo.setSubject("数学");
        scoreInfoList.add(scoreInfo);

        scoreInfo = new ScoreInfo();
        scoreInfo.setId(516);
        scoreInfo.setGuid(516L);
        scoreInfo.setStudentInfoId(511);
        scoreInfo.setStudentInfoGuid(511L);
        scoreInfo.setScore(516.0);
        scoreInfo.setSubject("物理");
        scoreInfoList.add(scoreInfo);

        scoreInfo = new ScoreInfo();
        scoreInfo.setId(517);
        scoreInfo.setGuid(517L);
        scoreInfo.setStudentInfoId(511);
        scoreInfo.setStudentInfoGuid(511L);
        scoreInfo.setScore(517.0);
        scoreInfo.setSubject("化学");
        scoreInfoList.add(scoreInfo);
        userInfo.setScoreInfoList(scoreInfoList);

        return userInfo;
    }

    public static List<ExportExcelTitle> getExportExcelTitleList() {
        List<ExportExcelTitle> list = new ArrayList<>();
//        "主键", "姓名", "金额", "年龄", "唯一标识","标识","双精度","日期时间", "备注"
        ExportExcelTitle excelTitle = new ExportExcelTitle();
        excelTitle.setName("id");
        excelTitle.setTitle("主键Id");
        list.add(excelTitle);

        excelTitle = new ExportExcelTitle();
        excelTitle.setName("name");
        excelTitle.setTitle("姓名");
        list.add(excelTitle);

        excelTitle = new ExportExcelTitle();
        excelTitle.setName("money");
        excelTitle.setTitle("金额");
        list.add(excelTitle);

        excelTitle = new ExportExcelTitle();
        excelTitle.setName("age");
        excelTitle.setTitle("年龄");
        list.add(excelTitle);

        excelTitle = new ExportExcelTitle();
        excelTitle.setName("guid");
        excelTitle.setTitle("唯一标识");
        list.add(excelTitle);

        excelTitle = new ExportExcelTitle();
        excelTitle.setName("flag");
        excelTitle.setTitle("标识");
        list.add(excelTitle);

        excelTitle = new ExportExcelTitle();
        excelTitle.setName("age");
        excelTitle.setTitle("年龄");
        list.add(excelTitle);
        return list;
    }
}
